package com.ruoyi.base.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.base.mapper.BaseRecordMapper;
import com.ruoyi.base.domain.BaseRecord;
import com.ruoyi.base.service.IBaseRecordService;

/**
 * 农事任务操作Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-05
 */
@Service
public class BaseRecordServiceImpl implements IBaseRecordService 
{
    @Autowired
    private BaseRecordMapper baseRecordMapper;

    /**
     * 查询农事任务操作
     * 
     * @param id 农事任务操作主键
     * @return 农事任务操作
     */
    @Override
    public BaseRecord selectBaseRecordById(Long id)
    {
        return baseRecordMapper.selectBaseRecordById(id);
    }

    /**
     * 查询农事任务操作列表
     * 
     * @param baseRecord 农事任务操作
     * @return 农事任务操作
     */
    @Override
    public List<BaseRecord> selectBaseRecordList(BaseRecord baseRecord)
    {
        return baseRecordMapper.selectBaseRecordList(baseRecord);
    }

    /**
     * 新增农事任务操作
     * 
     * @param baseRecord 农事任务操作
     * @return 结果
     */
    @Override
    public int insertBaseRecord(BaseRecord baseRecord)
    {
        baseRecord.setCreateTime(DateUtils.getNowDate());
        return baseRecordMapper.insertBaseRecord(baseRecord);
    }

    /**
     * 修改农事任务操作
     * 
     * @param baseRecord 农事任务操作
     * @return 结果
     */
    @Override
    public int updateBaseRecord(BaseRecord baseRecord)
    {
        return baseRecordMapper.updateBaseRecord(baseRecord);
    }

    /**
     * 批量删除农事任务操作
     * 
     * @param ids 需要删除的农事任务操作主键
     * @return 结果
     */
    @Override
    public int deleteBaseRecordByIds(Long[] ids)
    {
        return baseRecordMapper.deleteBaseRecordByIds(ids);
    }

    /**
     * 删除农事任务操作信息
     * 
     * @param id 农事任务操作主键
     * @return 结果
     */
    @Override
    public int deleteBaseRecordById(Long id)
    {
        return baseRecordMapper.deleteBaseRecordById(id);
    }
}
